package org.java.vm;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;

public class CommandWriter {

    private PrintWriter printWriter;

    public CommandWriter(File asmFile) {
        try {
            printWriter = new PrintWriter(asmFile);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }

    public void output(String... commands) {
        for (String command : commands) {
            printWriter.println(command);
        }
        printWriter.flush();
    }

    public void close() {
        printWriter.close();
    }
}
